<template>
  <div>
    <span v-for="(item, index) in arr" :key="index">
      <input type="checkbox" v-model="msg" :value="item" />{{ item }}
    </span>
    <p>您选中的值累加得 {{ sum }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: [9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
      msg: [],
    };
  },
  computed: {
    sum() {
      return this.msg.reduce((num, val) => (num += val), 0);
    },
  },
};
</script>

<style>
</style>